ActionController::Routing::Routes.draw do |map|

  map.connect '/transportes/existendt/:ndt', :controller => 'transportes', :action => 'existendt'
  map.connect '/transportes/cancelados', :controller => 'transportes', :action => 'cancelados'
  map.connect '/transportes/liberados', :controller => 'transportes', :action => 'liberados'
  map.connect '/transportes/gerais', :controller => 'transportes', :action => 'gerais'
  map.connect '/transportes/celcli', :controller => 'transportes', :action => 'celcli'
  map.connect '/transportes/wm', :controller => 'transportes', :action => 'wm'
  map.connect '/transportes/faturados', :controller => 'transportes', :action => 'faturados'
  map.connect '/transportes/faturadosdia', :controller => 'transportes', :action => 'faturadosdia'
  map.connect '/historicos/faturamento_acumulados', :controller => 'historicos', :action => 'faturamento_acumulados'
  
  map.resources :users 
  map.resources :transportes, 
	:collection => {
		:gerais => :get, 
		:cancelados => :get, 
		:liberados => :get, 
		:wm => :get, 
		:faturados => :get, 
		:celcli => 
		:get, 
		:faturadosdia => :get,
		:faturadosmes => :get
	}, 
	:member => {
		:cancelados => :post, 
		:gerais => :post, 
		:liberados => :post, 
		:wm => :post, 
		:faturados => :post, 
		:celcli => :post, 
		:faturadosdia => :post,
		:faturadosmes => :post		
	}
	
 map.resources :historicos, 
	 :collection => {:faturamento_acumulados => :get}, 
	 :member => {:faturamento_acumulados => :post}

  map.resources :transportadoras, :active_scaffold => true
  map.resources :editarstatus, :active_scaffold => true
  map.resources :settings, :active_scaffold => true
  map.resources :depositos, :active_scaffold => true
  map.resources :destinos, :active_scaffold => true
  map.resources :tipos, :active_scaffold => true
  map.resources :statuses, :active_scaffold => true
  map.resources :celcli, :active_scaffold => true
  map.resources :wm, :active_scaffold => true
  map.resources :liberados, :active_scaffold => true
  map.resources :cancelados, :active_scaffold => true
  map.resources :transportegerais, :active_scaffold => true
  map.resources :fatants, :active_scaffold => true
  map.resources :fatdeps, :active_scaffold => true
  map.resources :ac_users, :active_scaffold => true


  map.resource  :session, :controller => 'session'

  map.activate '/activate/:activation_code', :controller => 'users', :action => 'activate', :activation_code => nil
  map.signup '/signup', :controller => 'users', :action => 'new'
  map.login '/login', :controller => 'session', :action => 'new'
  map.logout '/logout', :controller => 'session', :action => 'destroy'
  map.connect '', :controller => 'inicio'
  map.connect '/paineis/wm', :controller => 'paineis', :action => 'wm'
  map.connect '/paineis/celcligerais', :controller => 'paineis', :action => 'celcligerais'  
  map.connect '/auditorias/busca', :controller => 'auditorias', :action => 'busca'
  map.connect '/auditorias/busca/processar_busca', :controller => 'auditorias', :action => 'processar_busca'

  
  #map.connect '/transportesgerais/edit/:id', :controller => 'transportes', :action => 'edit'


  # The priority is based upon order of creation: first created -> highest priority.

  # Sample of regular route:
  #   map.connect 'products/:id', :controller => 'catalog', :action => 'view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   map.resources :products

  # Sample resource route with options:
  #   map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }

  # Sample resource route with sub-resources:
  #   map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
  
  # Sample resource route with more complex sub-resources
  #   map.resources :products do |products|
  #     products.resources :comments
  #     products.resources :sales, :collection => { :recent => :get }
  #   end

  # Sample resource route within a namespace:
  #   map.namespace :admin do |admin|
  #     # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
  #     admin.resources :products
  #   end

  # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
  # map.root :controller => "welcome"

  # See how all your routes lay out with "rake routes"

  # Install the default routes as the lowest priority.
  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'
end
